package com.xm.service.background;

import com.xm.dao.background.CategoryDao;
import com.xm.entity.Category;
import com.xm.exception.SqlErrorException;

import java.util.List;

/**
 * 大类别Service
 * @author 康文程
 * @date 2024-1-20 下午 02:21
 */
public class CategoryService {
    private final CategoryDao dao = new CategoryDao();
    /**
     * 根据 model_id 查询 category_name 和 category_id
     *
     * @param modelId 模型ID
     * @return String[] [category_name, category_id]
     * @throws SqlErrorException SQL执行异常
     */
    public List<Category> findCategoryByModelId(int modelId) throws SqlErrorException {
        return dao.findCategoryByModelId(modelId);
    }

}
